<script type="text/javascript">
    $(document).ready(function(){
        $("#slide img").each(function(){
            var img_src=$(this).attr("_src");
            $(this).attr("src",img_src);
        });
    });
</script>


<div class="container">
    <div class="row">
        <div id="slide">
            <div class="hd">
                <ul></ul>
            </div>
            <div class="bd">
                <ul>
                    <?php foreach ($banners as $banner):?>
                    <li>
                        <a href="<?php echo $banner['link']?>">
                            <img _src="<?php echo show_pic($banner['pic'])?>" ppsrc="<?php echo show_pic($banner['pic'])?>"/>
                        </a>
                    </li>
                    <?php endforeach;?>
                </ul>
            </div>
        </div>
    </div>

    <script type="text/javascript" src="/v2/js/TouchSlide.1.1.js"></script>

    <div class="row category">
        <a href="/product/list/type/4.html" class="col-xs-3">
            <img class="img-responsive" src="/v2/images/icon_gd.png?1">
        </a>
        <a href="/product/list/type/3.html" class="col-xs-3">
            <img class="img-responsive" src="/v2/images/icon_sh.png?1">
        </a>
        <a href="/product/list/type/2.html" class="col-xs-3">
            <img class="img-responsive" src="/v2/images/icon_fj.png?1">
        </a>
        <a href="/product/list/type/6.html" class="col-xs-3">
            <img class="img-responsive" src="/v2/images/icon_hb.png?1">
        </a>
    </div>

    <div class="row">
        <div style="padding-bottom: 10px; background: #fff;">
        </div>
        <?php foreach($modules as $mk=>$mo):?>
            <!--产品块-->
            <div class="tb_box">
                <div class="tb_type tb_type_even clearfix">
                    <?php
                    foreach($mo['products'] as $k=>$product):
                    ?>
                    <a class="th_link" href="/product/detail/goods_id/<?php echo $product['id']?>.html">
                        <img width="100%" class="tb_pic" src="<?php echo show_pic($product['product_pic'])?>">
                    </a>
                    <?php endforeach;?>
                </div>
            </div>
            <!--产品块 END-->
        <?php endforeach;?>
    </div>
</div>
<script type="text/javascript">
    <?php
    $item = [
                    'title'=>'天天加油',
                    'meta_keyword'=>'',
                    'meta_description'=>'国内唯一官方指定手机加油站：天天优惠，天天赚钱！',
                    'pic'=>[DOMAIN.'/mex/images/getheadimg.jpg?123'],
                ];
    ?>
    wx.ready(function () {
        var shareData = {
            title: '<?=$item['title']?>',
            desc: '<?=$item['meta_description']?>',
            link: window.location.href,
            imgUrl: '<?=$item['pic'][0]?>',
            fail: function (res) {
                alert(JSON.stringify(res));
            }
        };

        var shareTimeLineData = {
            title: '<?=$item['meta_description']?>',
            link: window.location.href,
            imgUrl: '<?=$item['pic'][0]?>',
            fail: function (res) {
                alert(JSON.stringify(res));
            }
        };

        wx.onMenuShareAppMessage(shareData);
        wx.onMenuShareTimeline(shareTimeLineData);
        wx.onMenuShareQQ(shareData);
        wx.onMenuShareWeibo(shareData);
    });
    $(document).ready(function(){

        TouchSlide({
            slideCell:"#slide",
            titCell:".hd ul", //开启自动分页 autoPage:true ，此时设置 titCell 为导航元素包裹层
            mainCell:".bd ul",
            effect:"left",
            autoPlay:true,//自动播放
            autoPage:true, //自动分页
            interTime:5000,
            switchLoad:"_src" //切换加载，真实图片路径为"_src"
        });

        $(".foot-con_2 a:eq(0)").addClass('active');
    })
</script>
